package Week5;

import java.util.Scanner;

public class Main {
	public static void main(String[] arge){
		int balance=1000;
		Account account=new Account(balance);
	}
}

class Account{
	private  int balance;
	public Account(int balance) {
		this.balance=balance;
	}
	public  int getBalance() {
		return balance;
	}
	public void setBalance(int balance) {
		this.balance = balance;
	}
	synchronized void deposit(int money){
		//存钱
		balance=balance+money;
	}
	synchronized void withdraw(int money){
		//取钱
		balance=balance-money;
	}
}